<template>
	<view>
		<xl-address-form
			:data="address"
			address-id=""
			address-api=""
			:propNames="{ isDefault: 'default' }"			
			color="#0a93ff"
			btnText="确认"
			btnTextColor="#fff"
			:routerBack="false"
			showContact
			showLocation
			@close="close"
			@submit="submit"
		/>
	</view>
</template>

<script setup>
	import { ref } from 'vue'
	
	const address = ref({
		id: 1,
		name: 'zs',
		tel: '13388888888',
    province: '北京',
    city: '北京',
    district: '海淀区',
		address: '颐和园路5号',
		isDefault: false
	})
	// 若不是页面返回，则设置routerBack为false，使用close事件处理
	function close(){
		uni.$xl.router.back()
	}
	// 提交保存或修改
	function submit(address){
		console.log(address);
		uni.$xl.toast(JSON.stringify(address))
	}
</script>

<style lang="scss" scoped>
	
</style>